package org.giovanolli.mumi.entities;

import java.util.ArrayList;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * The Class HelpItem.
 */
@Entity
@Table(name = "help_item")
public class HelpItem extends IdentificableEntity {

	/** The Constant serialVersionUID. */
	private static final long serialVersionUID = -6319316339223660982L;

	/** The help id. */
	@Column(name = "help_id", nullable = false)
	private String helpId;

	/** The title. */
	@Column(name = "title")
	private String title;

	/** The content. */
	@Column(name = "content", length = 1000, nullable = false)
	private String content;

	/** The children. */
	@OneToMany
	@JoinColumn(name = "parent")
	private List<HelpItem> children = new ArrayList<HelpItem>();

	/**
	 * Gets the children.
	 * 
	 * @return the children
	 */
	public List<HelpItem> getChildren() {
		return children;
	}

	/**
	 * Gets the content.
	 * 
	 * @return the content
	 */
	public String getContent() {
		return content;
	}

	/**
	 * Gets the help id.
	 * 
	 * @return the help id
	 */
	public String getHelpId() {
		return helpId;
	}

	/**
	 * Gets the title.
	 * 
	 * @return the title
	 */
	public String getTitle() {
		return title;
	}

	/**
	 * Sets the children.
	 * 
	 * @param children
	 *            the new children
	 */
	public void setChildren(List<HelpItem> children) {
		this.children = children;
	}

	/**
	 * Sets the content.
	 * 
	 * @param content
	 *            the new content
	 */
	public void setContent(String content) {
		this.content = content;
	}

	/**
	 * Sets the help id.
	 * 
	 * @param helpId
	 *            the new help id
	 */
	public void setHelpId(String helpId) {
		this.helpId = helpId;
	}

	/**
	 * Sets the title.
	 * 
	 * @param title
	 *            the new title
	 */
	public void setTitle(String title) {
		this.title = title;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.giovanolli.mumi.entities.IdentificableEntity#toString()
	 */
	@Override
	public String toString() {
		return "HelpItem [helpId=" + helpId + ", content=" + content + "]";
	}

}
